package com.itheima.server.task;

import com.itheima.server.service.ActiviteService;
import com.itheima.server.service.ContractService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//每天23:59:59执行一次 检查活动是否结束
@Component
@Slf4j
public class ActiviteJob {
    @Autowired
    private ActiviteService activiteService;

    //每天的23:59:59执行一次
    @Scheduled(cron = "59 59 23 * * ?")
    public void executeActivite(){
        log.info("定时任务：检查合同状态 23：59：59");
        activiteService.executeActivite();
    }



}
